<template>
    <Form ref="formData" :model="formData" :rules="ruleValidate" :label-width="120">
        <FormItem label="字典编码" prop="typeCode">
            <Input v-model="formData.typeCode" ></Input>
        </FormItem>
        <FormItem label="字典类型名称" prop="typeName">
            <Input v-model="formData.typeName" ></Input>
        </FormItem>
        <FormItem label="备注" prop="remark">
            <Input v-model="formData.remark" ></Input>
        </FormItem>
        <div style="text-align: center;margin: 15px">
            <Button @click="handleReset('formData')">重置</Button>
            <Button type="primary" @click="handleSubmit('formData')" style="margin-left: 8px">保存</Button>
        </div>
        <!--加载中显示 -->
        <Spin size="large" fix v-if="spinShow"></Spin>
    </Form>
</template>

<script>
    import Base from '@/components/table/BaseEdit.vue';
    export default {
        extends:Base,
        data () {
            return {
                ruleValidate: {
                    typeCode: [
                        { required: true, message: '请输入字典编码!', trigger: 'blur' },
                    ],
                    typeName: [
                        { required: true, message: '请输入字典类型名称!', trigger: 'blur' },
                    ],
                }
            }
        },
        methods: {
            loadDataById(id){
                this.load("/api/system/dict/type/read",{id})
            },handleSubmit (name) {
                //保存
                this.save(name,"/api/system/dict/type/save");
            },
        }
    }
</script>

<style scoped>

</style>
